﻿using System;
using System.Collections;

namespace UDS.Components
{
    public class Contact
    {
        public ArrayList arrCooperater = new ArrayList();
        public ArrayList arrLinkman = new ArrayList();
        private string bargainprognosis = "";
        private string contactaim = "";
        private string contactcontent = "";
        private string contactstatus = "";
        private DateTime contacttime = DateTime.Now;
        private string contacttype = "";
        private string feeused = "";
        private string nextcontactaim = "";
        private DateTime nextcontacttime = DateTime.Now;
        private string sellmoney = "";
        private DateTime updatetime = DateTime.Now;

        /// <summary>
        /// 接触ID
        /// </summary>
        public int ID
        {
            get;
            set;
        }

        /// <summary>
        /// 销售人员id
        /// </summary>
        public int StaffID
        {
            get;
            set;
        }

        /// <summary>
        /// 客户ID
        /// </summary>
        public int ClientID
        {
            get;
            set;
        }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime
        {
            get { return updatetime; }
            set { updatetime = value; }
        }

        /// <summary>
        /// 接洽次数
        /// </summary>
        public int ContactTimes
        {
            get;
            set;
        }

        /// <summary>
        /// 接触目的
        /// </summary>
        public string ContactAim
        {
            get { return contactaim; }
            set { contactaim = value; }
        }

        /// <summary>
        /// 近期标的
        /// </summary>
        public string SellMoney
        {
            get { return sellmoney; }
            set { sellmoney = value; }
        }

        /// <summary>
        /// 成交预估
        /// </summary>
        public string BargainPrognosis
        {
            get { return bargainprognosis; }
            set { bargainprognosis = value; }
        }

        /// <summary>
        /// 接触状态
        /// </summary>
        public string ContactType
        {
            get { return contacttype; }
            set { contacttype = value; }
        }

        /// <summary>
        /// 接触状态
        /// </summary>
        public string ContactStatus
        {
            get { return contactstatus; }
            set { contactstatus = value; }
        }

        /// <summary>
        /// 本次费用
        /// </summary>
        public float ThisFee
        {
            get;
            set;
        }

        /// <summary>
        /// 费用用途
        /// </summary>
        public string FeeUsed
        {
            get { return feeused; }
            set { feeused = value; }
        }

        /// <summary>
        /// 接触内容
        /// </summary>
        public string ContactContent
        {
            get { return contactcontent; }
            set { contactcontent = value; }
        }

        /// <summary>
        /// 下次接触目的
        /// </summary>
        public string NextContactAim
        {
            get { return nextcontactaim; }
            set { nextcontactaim = value; }
        }

        /// <summary>
        /// 接触时间
        /// </summary>
        public DateTime ContactTime
        {
            get { return contacttime; }
            set { contacttime = value; }
        }

        /// <summary>
        /// 下次接触时间
        /// </summary>
        public DateTime NextContactTime
        {
            get { return nextcontacttime; }
            set { nextcontacttime = value; }
        }

        /// <summary>
        /// 添加协同人员
        /// </summary>
        /// <param name="cooperater"></param>
        public void AddCooperater(Cooperater cooperater)
        {
            if (!arrCooperater.Contains(cooperater))
            {
                arrCooperater.Add(cooperater);
            }
        }

        /// <summary>
        /// 移除协同人员
        /// </summary>
        /// <param name="cooperater"></param>
        public void DelCooperater(Cooperater cooperater)
        {
            if (arrCooperater.Contains(cooperater))
            {
                arrCooperater.Remove(cooperater);
            }
            else
            {
                throw new Exception("要删除的对象不存在");
            }
        }

        /// <summary>
        /// 添加联系人
        /// </summary>
        /// <param name="linkman"></param>
        public void AddLinkman(Linkman linkman)
        {
            if (!arrLinkman.Contains(linkman))
            {
                arrLinkman.Add(linkman);
            }
        }

        /// <summary>
        /// 移出联系人
        /// </summary>
        /// <param name="linkman"></param>
        public void DelLinkman(Linkman linkman)
        {
            if (arrLinkman.Contains(linkman))
            {
                arrLinkman.Remove(linkman);
            }
            else
            {
                throw new Exception("要删除的对象不存在");
            }
        }
    }
}